// pages/cai/caicai.js
let numUser
let numComputer
Page({

    onLoad: function (options) {
        numComputer=parseInt(Math.random()*100)
        console.log('计算机想的数据=',numComputer)
    },
    input: function(e){
        numUser=e.detail.value
    },
    caicai:function(e){
      if (numUser==numComputer) {
        console.log("恭喜你猜对了")
      } else if (numUser<numComputer) {
        console.log("猜小了")
      } else if (numUser>numComputer) {
        console.log("猜大了")
      }
    }
})